package Operation;

import Book.Book;
import Book.Booklist;


import java.sql.SQLOutput;
import java.util.Scanner;

public class addBook implements Ioperation{
    @Override
    public void work(Booklist booklist) {
        System.out.println("新增书籍");
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入书名");
        String name= sc.nextLine();
        System.out.println("请输入作者");
        String author= sc.nextLine();
        System.out.println("请输入价格");
        int price=sc.nextInt();
        String a=sc.nextLine();
        System.out.println("请输入书的类型");
        String type=sc.nextLine();
        Book book=new Book(name,author,price,type,false);
        int size=booklist.getSizeBook();
        booklist.setBook(size,book);
        size++;
        booklist.setSizeBook(size);
        System.out.println("已经成功添加你的书籍");
    }
}
